var requestId;
$(function () {
    var request = JSON.parse(reqStr);
    requestId = request.id;
    $('#requestNo').html(request.requestNo);
    $('#bankRequestNo').html(request.bankRequestNo);
    if(request.requestType =='0')
    {
        $('#requestType').html('查询');
    }else{
        $('#requestType').html('拒付');
    }
    if(request.interceptState =='1'){
        $('#interceptState').html("是");
    }else{
        $('#interceptState').html("否");
    }
    if(request.emergencyState =='0')
    {
        $('#emergencyState').html('普通');
    }else{
        $('#emergencyState').html('紧急');
    }

    $('#tradeDate').html(request.tradeDate);
    $('#tradeMoney').html(request.tradeMoney);
    $('#realName').html(request.realName);
    $('#certno').html(request.certno);
    $('#telephone').html(request.telephone);
    $('#remark').html(request.remark);
    if(request.bankRequestState == '2')
    {
        $('#bankRequestState').html("已回复");
        $('#send-tip').show();
        $('#no-send-tip').hide();
    }else{
        $('#bankRequestState').html("未回复");
        $('#send-tip').hide();
        $('#no-send-tip').show();
    }
    var fileNames =  request.bankAttachFile.split(",");
    $.each(fileNames , function(index ,item){
        item = $.trim(item);
        if(item && item.length >0)
        {
            var tmp =  "<span data='"+item+"'>附件：<a href=\"javascript:void(0)\" onclick=\"downloadFile('"+item+"')\" >"+item
                +"</a> </span>";
            $('#fileListDiv').append(tmp);
        }
    });
});

function downloadFile(fileName)
{
    window.location.href = queryPath+"/downloadFile.do?fileName="+fileName;
}